home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 1996 June / Software of the Month Club 1996 June.iso / pc / os2 / fm2 / install.cmd < prev    next >
OS/2 REXX Batch file  |  1996-03-17  |  47KB  |  1,144 lines

  1. /*
  2.  * FM/2 2.x installation program copyright (c) 1994/96 by M. Kimes
  3.  *
  4.  * This program creates folders to hold program and data objects,
  5.  * then creates program objects for each executable.  It only needs to be
  6.  * run once (unless you move the FM/2 directory -- see say notes at end).
  7.  * Run this program in the FM/2 directory (where you unpacked the archive).
  8.  *
  9.  * For unattended installation, remove the lines marked with "NOTE:" below.
  10.  */
  11.  
  12. /* see if we might be in the right directory... */
  13.  
  14. '@Echo off'
  15. 'cls'
  16.  
  17. say'     ┌───────────────────────────────────────────────────────────────────┐'
  18. say'     │                  FM/2 2.x Installation Program                    │'
  19. say'     │             FM/2 is copyright (c) 1993-96 by M. Kimes             │'
  20. say'     │                       All rights reserved                         │'
  21. say'     ├───────────────────────────────────────────────────────────────────┤'
  22. say'     ├───────────────────────────────────────────────────────────────────┤'
  23. say'     │                Have you read the READ.ME file yet?                │'
  24. say'     │        By running this program, you agree to the license          │'
  25. say'     │                     as specified in that file,                    │'
  26. say'     │      and it tells you how to install, so you should read it.      │'
  27. say'     │                             Please?                               │'
  28. say'     └───────────────────────────────────────────────────────────────────┘'
  29.  
  30. /*
  31.  * allow user to eliminate associations from being placed on AV/2.
  32.  * seemed to upset some fellow on CIS (I guess he doesn't know about
  33.  * Settings notebooks on WPS objects).
  34.  */
  35. assocfilter = ';ASSOCFILTER=*.ZIP,*.ARC,*.LZH,*.ARJ,*.ZOO,*.MO0,READ.ME,README,README.1ST,README.OS2,REGISTER.TXT'
  36. existed = ''
  37. parse upper arg dummy
  38. if dummy = 'NOASSOC' then assocfilter = ''
  39.  
  40. rc = stream('fm3.exe','c','query exists')
  41. if rc = '' then
  42. do
  43.   say 'Sorry, FM3.EXE not found.  Must not be right directory.  Terminating.'
  44.   exit
  45. end
  46.  
  47. /* tell user what we're doing, give him a chance to hit CTRL-C */
  48.  
  49. say ''
  50. say 'This program creates objects for FM/2 and does some drudgework for you.'
  51. say ''
  52.  
  53. /* load rexx utility functions */
  54.  
  55. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  56. call SysLoadFuncs
  57.  
  58. /* NOTE:  remove following 6 lines for unattended use... */
  59. call charout ,'  Press [Enter] to continue...'
  60. dummy = ''
  61. do until dummy = '0d'x
  62.   dummy = SysGetKey('NOECHO')
  63. end
  64. call charout ,'0d1b'x'[K'
  65.  
  66. /* save current directory */
  67.  
  68. curdir = directory()
  69.  
  70. /* say it, then do it */
  71.  
  72. say "Creating File Manager/2 folders and objects..."
  73.  
  74. /* first, create FM/2 folder */
  75.  
  76. rc = stream('fm2fldr.ico','c','query exists')
  77. title = "File Manager/2"
  78. classname = 'WPFolder'
  79. location = '<WP_DESKTOP>'
  80. setup = 'OBJECTID=<FM3_Folder>;OPEN=DEFAULT'
  81. if rc \= '' then setup = setup';ICONFILE='rc
  82. result = SysCreateObject(classname,title,location,setup,f)
  83. if rc \= '' then
  84. do
  85.   'DEL 'rc' 1>NUL 2>NUL'
  86. end
  87.  
  88. /* NOTE:  remove following 18 lines for unattended use... */
  89. if result = 0 then
  90. do
  91.   assocfilter = ''
  92.   existed = 'TRUE'
  93.   say ''
  94.   say 'The File Manager/2 folder already exists.'
  95.   call charout ,"Should I update the objects (it's painless)? (Y/N) "
  96.   dummy = ''
  97.   do forever
  98.     dummy = SysGetKey('NOECHO')
  99.     parse upper var dummy dummy
  100.     if dummy = '1b'x then dummy = 'N'
  101.     if dummy = '0d'x then dummy = 'Y'
  102.     if dummy = 'N' then leave
  103.     if dummy = 'Y' then leave
  104.   end
  105.   call charout ,dummy
  106.   say ''
  107.   if dummy = 'N' then exit
  108. end
  109.  
  110. /* create objects in appropriate folders */
  111.  
  112. rc = stream('fm3.exe','c','query exists')
  113. if rc \= '' then
  114. do
  115.   title = "FM/2"
  116.   classname = 'WPProgram'
  117.   location = '<FM3_Folder>'
  118.   setup = 'OBJECTID=<FM/2>;EXENAME='rc';STARTUPDIR='curdir
  119.   if existed = '' then setup = setup';PARAMETERS=%*'
  120.   call SysCreateObject classname,title,location,setup,u
  121. end
  122.  
  123. /* create toolbox folder in FM/2 folder */
  124. rc = stream('toolbox.ico','c','query exists')
  125. title = "FM/2 Tools"
  126. classname = 'WPFolder'
  127. location = '<FM3_Folder>'
  128. setup = 'OBJECTID=<FM3_Tools>;OPEN=DEFAULT'
  129. if rc \= '' then setup = setup';ICONFILE='rc
  130. result = SysCreateObject(classname,title,location,setup,u)
  131. if rc \= '' then
  132. do
  133.   'DEL 'rc' 1>NUL 2>NUL'
  134. end
  135.  
  136. rc = stream('av2.exe','c','query exists')
  137. if rc \= '' then
  138. do
  139.   title = "Archive Viewer/2"
  140.   classname = 'WPProgram'
  141.   location = '<FM3_Tools>'
  142.   setup = 'EXENAME='rc';STARTUPDIR='curdir''assocfilter
  143.   if existed = '' then setup = setup';PARAMETERS=%*'
  144.   call SysCreateObject classname,title,location,setup,u
  145. end
  146.  
  147. rc = stream('eas.exe','c','query exists')
  148. if rc \= '' then
  149. do
  150.   title = "EA Viewer"
  151.   classname = 'WPProgram'
  152.   location = '<FM3_Tools>'
  153.   setup = 'EXENAME='rc';STARTUPDIR='curdir
  154.   if existed = '' then setup = setup';PARAMETERS=%*'
  155.   call SysCreateObject classname,title,location,setup,u
  156. end
  157.  
  158. rc = stream('ini.exe','c','query exists')
  159. if rc \= '' then
  160. do
  161.   if assocfilter \= '' then assocfilter = ';ASSOCFILTER=*.INI'
  162.   title = "INI Viewer"
  163.   classname = 'WPProgram'
  164.   location = '<FM3_Tools>'
  165.   setup = 'EXENAME='rc';STARTUPDIR='curdir''assocfilter
  166.   if existed = '' then setup = setup';PARAMETERS=%*'
  167.   call SysCreateObject classname,title,location,setup,u
  168. end
  169.  
  170. rc = stream('viewinfs.exe','c','query exists')
  171. if rc \= '' then
  172. do
  173.   title = "Bookshelf Viewer"
  174.   classname = 'WPProgram'
  175.   location = '<FM3_Tools>'
  176.   setup = 'EXENAME='rc';STARTUPDIR='curdir
  177.   call SysCreateObject classname,title,location,setup,u
  178.   title = "Helpfile Viewer"
  179.   classname = 'WPProgram'
  180.   location = '<FM3_Tools>'
  181.   setup = 'EXENAME='rc';PARAMETERS=DUMMY;STARTUPDIR='curdir
  182.   call SysCreateObject classname,title,location,setup,u
  183. end
  184.  
  185. rc = stream('killproc.exe','c','query exists')
  186. if rc \= '' then
  187. do
  188.   title = "Process Killer"
  189.   classname = 'WPProgram'
  190.   location = '<FM3_Tools>'
  191.   setup = 'OBJECTID=<FM/2_KILLPROC>;EXENAME='rc';PARAMETERS=%;STARTUPDIR='curdir
  192.   call SysCreateObject classname,title,location,setup,u
  193. end
  194.  
  195. rc = stream('undel.exe','c','query exists')
  196. if rc \= '' then
  197. do
  198.   title = "Undeleter"
  199.   classname = 'WPProgram'
  200.   location = '<FM3_Tools>'
  201.   setup = 'OBJECTID=<FM/2_UNDEL>;EXENAME='rc';STARTUPDIR='curdir
  202.   if existed = '' then setup = setup';PARAMETERS=%*'
  203.   call SysCreateObject classname,title,location,setup,u
  204. end
  205.  
  206. rc = stream('vtree.exe','c','query exists')
  207. if rc \= '' then
  208. do
  209.   title = "Visual Tree"
  210.   classname = 'WPProgram'
  211.   location = '<FM3_Tools>'
  212.   setup = 'OBJECTID=<FM/2_VTREE>;EXENAME='rc';STARTUPDIR='curdir
  213.   call SysCreateObject classname,title,location,setup,u
  214. end
  215.  
  216. rc = stream('vdir.exe','c','query exists')
  217. if rc \= '' then
  218. do
  219.   title = "Visual Directory"
  220.   classname = 'WPProgram'
  221.   location = '<FM3_Tools>'
  222.   setup = 'OBJECTID=<FM/2_VDIR>;EXENAME='rc';STARTUPDIR='curdir
  223.   if existed = '' then setup = setup';PARAMETERS=%*'
  224.   call SysCreateObject classname,title,location,setup,u
  225. end
  226.  
  227. rc = stream('vcollect.exe','c','query exists')
  228. if rc \= '' then
  229. do
  230.   title = "Collector"
  231.   classname = 'WPProgram'
  232.   location = '<FM3_Tools>'
  233.   setup = 'OBJECTID=<FM/2_VCOLLECT>;EXENAME='rc';STARTUPDIR='curdir
  234.   call SysCreateObject classname,title,location,setup,u
  235.   title = "Seek and scan"
  236.   classname = 'WPProgram'
  237.   location = '<FM3_Tools>'
  238.   setup = 'OBJECTID=<FM/2_VSEEK>;EXENAME='rc';PARAMETERS=**;STARTUPDIR='curdir
  239.   call SysCreateObject classname,title,location,setup,u
  240. end
  241.  
  242. rc = stream('global.exe','c','query exists')
  243. if rc \= '' then
  244. do
  245.   title = "Global File Viewer"
  246.   classname = 'WPProgram'
  247.   location = '<FM3_Tools>'
  248.   setup = 'OBJECTID=<FM/2_SEEALL>;EXENAME='rc';STARTUPDIR='curdir
  249.   call SysCreateObject classname,title,location,setup,u
  250. end
  251.  
  252. rc = stream('databar.exe','c','query exists')
  253. if rc \= '' then
  254. do
  255.   title = "Databar"
  256.   classname = 'WPProgram'
  257.   location = '<FM3_Tools>'
  258.   setup = 'OBJECTID=<FM/2_DATABAR>;EXENAME='rc';STARTUPDIR='curdir
  259.   call SysCreateObject classname,title,location,setup,u
  260. end
  261.  
  262. rc = stream('sysinfo.exe','c','query exists')
  263. if rc \= '' then
  264. do
  265.   title = "SysInfo"
  266.   classname = 'WPProgram'
  267.   location = '<FM3_Tools>'
  268.   setup = 'OBJECTID=<FM/2_SYSINFO>;EXENAME='rc';STARTUPDIR='curdir
  269.   call SysCreateObject classname,title,location,setup,u
  270. end
  271.  
  272. rc = stream('READ.ME','c','query exists')
  273. if rc \= '' then
  274. do
  275.   title = "Read.Me"
  276.   classname = 'WPShadow'
  277.   location = '<FM3_Folder>'
  278.   setup = 'SHADOWID='rc
  279.   call SysCreateObject classname,title,location,setup,u
  280. end
  281.  
  282. rc = stream('HISTORY.TXT','c','query exists')
  283. if rc \= '' then
  284. do
  285.   title = "History.Txt"
  286.   classname = 'WPShadow'
  287.   location = '<FM3_Folder>'
  288.   setup = 'SHADOWID='rc
  289.   call SysCreateObject classname,title,location,setup,u
  290. end
  291.  
  292. rc = stream('REGISTER.TXT','c','query exists')
  293. if rc \= '' then
  294. do
  295.   title = "Register.Txt"
  296.   classname = 'WPShadow'
  297.   location = '<FM3_Folder>'
  298.   setup = 'SHADOWID='rc
  299.   call SysCreateObject classname,title,location,setup,u
  300. end
  301.  
  302. rc = stream('FM3.HLP','c','query exists')
  303. if rc \= '' then
  304. do
  305.   if assocfilter \= '' then assocfilter=';ASSOCFILTER=*.HLP'
  306.   rc = stream('SEEHELP.EXE','c','query exists')
  307.   if rc \= '' then
  308.   do
  309.     title = "FM/2 Online Help"
  310.     classname = 'WPProgram'
  311.     location = '<FM3_Folder>'
  312.     setup = 'EXENAME='rc';STARTUPDIR='curdir';PARAMETERS= %* 'curdir'\FM3.HLP'
  313.     call SysCreateObject classname,title,location,setup,u
  314.   end
  315. end
  316.  
  317. rc = stream('UTILS\MAKEOBJ.CMD','c','query exists')
  318. if rc \= '' then
  319. do
  320.   title = "Make Object"
  321.   classname = 'WPProgram'
  322.   location = '<FM3_Tools>'
  323.   setup = 'EXENAME='rc';STARTUPDIR='curdir'\UTILS;PARAMETERS=%*'
  324.   call SysCreateObject classname,title,location,setup,u
  325. end
  326.  
  327. rc = stream('UTILS\FM2UTILS.DOC','c','query exists')
  328. if rc \= '' then
  329. do
  330.   title = "FM2UTILS.DOC"
  331.   classname = 'WPShadow'
  332.   location = '<FM3_Tools>'
  333.   setup = 'SHADOWID='rc
  334.   call SysCreateObject classname,title,location,setup,u
  335. end
  336.  
  337. /* create sample customizations for the user so they don't start 'blank' */
  338.  
  339. rc = stream('FM3MENU.DAT','c','query exists')
  340. if rc = '' then
  341. do
  342.   rc = stream('FM2MENU.TMP','c','query exists')
  343.   if rc \= '' then
  344.   do
  345.     say 'Creating a sample FM3MENU.DAT file for you.'
  346.     'REN FM3MENU.TMP FM3MENU.DAT 1>NUL 2>NUL'
  347.   end
  348. end
  349. 'DEL FM3MENU.TMP 1>NUL 2>NUL'
  350. rc = stream('ASSOC.DAT','c','query exists')
  351. if rc = '' then
  352. do
  353.   rc = stream('ASSOC.TMP','c','query exists')
  354.   if rc \= '' then
  355.   do
  356.     say 'Creating a sample ASSOC.DAT file for you.'
  357.     'REN ASSOC.TMP ASSOC.DAT 1>NUL 2>NUL'
  358.   end
  359. end
  360. 'DEL ASSOC.TMP 1>NUL 2>NUL'
  361. rc = stream('COMMANDS.DAT','c','query exists')
  362. if rc = '' then
  363. do
  364.   rc = stream('COMMANDS.TMP','c','query exists')
  365.   if rc \= '' then
  366.   do
  367.     say 'Creating a sample COMMANDS.DAT file for you.'
  368.     'REN COMMANDS.TMP COMMANDS.DAT 1>NUL 2>NUL'
  369.   end
  370. end
  371. 'DEL COMMANDS.TMP 1>NUL 2>NUL'
  372. rc = stream('FILTERS.DAT','c','query exists')
  373. if rc = '' then
  374. do
  375.   rc = stream('FILTERS.TMP','c','query exists')
  376.   if rc \= '' then
  377.   do
  378.     say 'Creating a sample FILTERS.DAT file for you.'
  379.     'REN FILTERS.TMP FILTERS.DAT 1>NUL 2>NUL'
  380.   end
  381. end
  382. 'DEL FILTERS.TMP 1>NUL 2>NUL'
  383. rc = stream('FM3TOOLS.DAT','c','query exists')
  384. if rc = '' then
  385. do
  386.   rc = stream('FM3TOOLS.TMP','c','query exists')
  387.   if rc \= '' then
  388.   do
  389.     say 'Installing an FM3TOOLS.DAT file for you.'
  390.     'REN FM3TOOLS.TMP FM3TOOLS.DAT 1>NUL 2>NUL'
  391.   end
  392. end
  393. 'DEL FM3TOOLS.TMP 1>NUL 2>NUL'
  394. rc = stream('QUICKTLS.DAT','c','query exists')
  395. if rc = '' then
  396. do
  397.   rc = stream('QUICKTLS.TMP','c','query exists')
  398.   if rc \= '' then
  399.   do
  400.     rc = stream('CMDS.TMP','c','query exists')
  401.     if rc \= '' then
  402.     do
  403.       rc = stream('UTILS.TMP','c','query exists')
  404.       if rc \= '' then
  405.       do
  406.         rc = stream('SORT.TMP','c','query exists')
  407.         if rc \= '' then
  408.         do
  409.           rc = stream('SELECT.TMP','c','query exists')
  410.           if rc \= '' then
  411.           do
  412.             say 'Creating a sample QUICKTLS.DAT file and toolboxes for you.'
  413.             'REN QUICKTLS.TMP QUICKTLS.DAT 1>NUL 2>NUL'
  414.             'REN CMDS.TMP CMDS.TLS 1>NUL 2>NUL'
  415.             'REN UTILS.TMP UTILS.TLS 1>NUL 2>NUL'
  416.             'REN SORT.TMP SORT.TLS 1>NUL 2>NUL'
  417.             'REN SELECT.TMP SELECT.TLS 1>NUL 2>NUL'
  418.           end
  419.           'DEL SELECT.TMP 1>NUL 2>NUL'
  420.         end
  421.        'DEL SORT.TMP 1>NUL 2>NUL'
  422.       end
  423.       'DEL UTILS.TMP 1>NUL 2>NUL'
  424.     end
  425.     'DEL CMDS.TMP 1>NUL 2>NUL'
  426.   end
  427. end
  428. 'DEL QUICKTLS.TMP 1>NUL 2>NUL'
  429.  
  430. /*
  431.  * create command files that the user can execute from anywhere (we'll
  432.  * ask the user to put this utils directory on the PATH) and that other
  433.  * programs can execute to use FM/2 as "their" file manager.
  434.  */
  435.  
  436. 'del SETENV.CMD 1>NUL 2>NUL'
  437. dummy = stream('SETENV.CMD','C','open')
  438. if dummy = 'READY:' then
  439. do
  440.   call lineout 'SETENV.CMD','@ECHO OFF'
  441.   call lineout 'SETENV.CMD','REM'
  442.   call lineout 'SETENV.CMD','REM If you prefer, you can call this .CMD file'
  443.   call lineout 'SETENV.CMD','REM instead of altering the PATH= statement in'
  444.   call lineout 'SETENV.CMD','REM CONFIG.SYS to gain access to the FM/2'
  445.   call lineout 'SETENV.CMD','REM command line utilities.'
  446.   call lineout 'SETENV.CMD','REM'
  447.   call lineout 'SETENV.CMD','IF "%FM2ENVSET%" == "" GOTO INSTALL'
  448.   call lineout 'SETENV.CMD','GOTO SKIP'
  449.   call lineout 'SETENV.CMD',':INSTALL'
  450.   call lineout 'SETENV.CMD','SET FM2ENVSET=YES'
  451.   call lineout 'SETENV.CMD','SET PATH=%PATH%;'curdir'\utils;'
  452.   call lineout 'SETENV.CMD','ECHO Path set for FM/2 and utilities.'
  453.   call lineout 'SETENV.CMD','GOTO END'
  454.   call lineout 'SETENV.CMD',':SKIP'
  455.   call lineout 'SETENV.CMD','ECHO Paths already set for FM/2 and utilities.'
  456.   call lineout 'SETENV.CMD',':END'
  457.   call stream 'SETENV.CMD','C','close'
  458. end
  459.  
  460. /*
  461.  * place an object for SETENV.CMD in folder so user doesn't have to diddle
  462.  * their PATH statement if they don't want to for command line work.
  463.  */
  464.  
  465.  
  466. rc = stream('SETENV.CMD','c','query exists')
  467. if rc \= '' then
  468. do
  469.   dummy = value('COMSPEC',,'OS2ENVIRONMENT')
  470.   if dummy = '' then dummy = value('OS2_SHELL',,'OS2ENVIRONMENT')
  471.   if dummy = '' then dummy = 'CMD.EXE'
  472.   title = "FM/2 Utilities command line"
  473.   classname = 'WPProgram'
  474.   location = '<FM3_Tools>'
  475.   setup = 'EXENAME='dummy';PARAMETERS=/K 'rc';STARTUPDIR=C:\'
  476.   call SysCreateObject classname,title,location,setup,u
  477. end
  478.  
  479. call SysMkDir curdir'\UTILS'
  480. dummy = directory(curdir'\UTILS')
  481. if dummy = curdir'\UTILS' then
  482. do
  483.   'set PATH=%PATH%;'curdir'\utils'
  484.   'move ..\example.cmd 1>NUL 2>NUL'
  485.   'del FM2.CMD 1>NUL 2>NUL'
  486.   dummy = stream('FM2.CMD','C','open')
  487.   if dummy = 'READY:' then
  488.   do
  489.     say 'Creating an FM2.CMD file.'
  490.     call lineout 'FM2.CMD', "/* FM/2 command file.  Locate in a directory"
  491.     call lineout 'FM2.CMD', " * on your PATH. */"
  492.     call lineout 'FM2.CMD', "'@echo off'"
  493.       call lineout 'FM2.CMD', "mydir = directory()"
  494.       call lineout 'FM2.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  495.       call lineout 'FM2.CMD', "if arg1 \= '' then "
  496.       call lineout 'FM2.CMD', "do"
  497.       call lineout 'FM2.CMD', "  if left(arg1,1,1) \= '/' then"
  498.       call lineout 'FM2.CMD', "  do"
  499.       call lineout 'FM2.CMD', "    arg0 = arg1"
  500.       call lineout 'FM2.CMD', "    arg1 = stream(arg1,'c','query exists')"
  501.       call lineout 'FM2.CMD', "    if arg1 = '' then"
  502.       call lineout 'FM2.CMD', "    do"
  503.       call lineout 'FM2.CMD', "      arg1 = directory(arg0)"
  504.       call lineout 'FM2.CMD', "      call directory mydir"
  505.       call lineout 'FM2.CMD', "    end"
  506.       call lineout 'FM2.CMD', "  end"
  507.       call lineout 'FM2.CMD', "end"
  508.       call lineout 'FM2.CMD', "else arg1 = mydir"
  509.       call lineout 'FM2.CMD', "if arg2 \= '' then "
  510.       call lineout 'FM2.CMD', "do"
  511.       call lineout 'FM2.CMD', "  if left(arg2,1,1) \= '/' then"
  512.       call lineout 'FM2.CMD', "  do"
  513.       call lineout 'FM2.CMD', "    arg0 = arg2"
  514.       call lineout 'FM2.CMD', "    arg2 = stream(arg2,'c','query exists')"
  515.       call lineout 'FM2.CMD', "    if arg2 = '' then"
  516.       call lineout 'FM2.CMD', "    do"
  517.       call lineout 'FM2.CMD', "      arg2 = directory(arg0)"
  518.       call lineout 'FM2.CMD', "      call directory mydir"
  519.       call lineout 'FM2.CMD', "    end"
  520.       call lineout 'FM2.CMD', "  end"
  521.       call lineout 'FM2.CMD', "end"
  522.       call lineout 'FM2.CMD', "if arg3 \= '' then "
  523.       call lineout 'FM2.CMD', "do"
  524.       call lineout 'FM2.CMD', "  if left(arg3,1,1) \= '/' then"
  525.       call lineout 'FM2.CMD', "  do"
  526.       call lineout 'FM2.CMD', "    arg0 = arg3"
  527.       call lineout 'FM2.CMD', "    arg3 = stream(arg3,'c','query exists')"
  528.       call lineout 'FM2.CMD', "    if arg3 = '' then"
  529.       call lineout 'FM2.CMD', "    do"
  530.       call lineout 'FM2.CMD', "      arg3 = directory(arg0)"
  531.       call lineout 'FM2.CMD', "      call directory mydir"
  532.       call lineout 'FM2.CMD', "    end"
  533.       call lineout 'FM2.CMD', "  end"
  534.       call lineout 'FM2.CMD', "end"
  535.       call lineout 'FM2.CMD', "if arg4 \= '' then "
  536.       call lineout 'FM2.CMD', "do"
  537.       call lineout 'FM2.CMD', "  if left(arg4,1,1) \= '/' then"
  538.       call lineout 'FM2.CMD', "  do"
  539.       call lineout 'FM2.CMD', "    arg0 = arg4"
  540.       call lineout 'FM2.CMD', "    arg4 = stream(arg4,'c','query exists')"
  541.       call lineout 'FM2.CMD', "    if arg4 = '' then"
  542.       call lineout 'FM2.CMD', "    do"
  543.       call lineout 'FM2.CMD', "      arg4 = directory(arg0)"
  544.       call lineout 'FM2.CMD', "      call directory mydir"
  545.       call lineout 'FM2.CMD', "    end"
  546.       call lineout 'FM2.CMD', "  end"
  547.       call lineout 'FM2.CMD', "end"
  548.       call lineout 'FM2.CMD', "if arg5 \= '' then "
  549.       call lineout 'FM2.CMD', "do"
  550.       call lineout 'FM2.CMD', "  if left(arg5,1,1) \= '/' then"
  551.       call lineout 'FM2.CMD', "  do"
  552.       call lineout 'FM2.CMD', "    arg0 = arg5"
  553.       call lineout 'FM2.CMD', "    arg5 = stream(arg5,'c','query exists')"
  554.       call lineout 'FM2.CMD', "    if arg5 = '' then"
  555.       call lineout 'FM2.CMD', "    do"
  556.       call lineout 'FM2.CMD', "      arg5 = directory(arg0)"
  557.       call lineout 'FM2.CMD', "      call directory mydir"
  558.       call lineout 'FM2.CMD', "    end"
  559.       call lineout 'FM2.CMD', "  end"
  560.       call lineout 'FM2.CMD', "end"
  561.       call lineout 'FM2.CMD', "if arg6 \= '' then "
  562.       call lineout 'FM2.CMD', "do"
  563.       call lineout 'FM2.CMD', "  if left(arg6,1,1) \= '/' then"
  564.       call lineout 'FM2.CMD', "  do"
  565.       call lineout 'FM2.CMD', "    arg0 = arg6"
  566.       call lineout 'FM2.CMD', "    arg6 = stream(arg6,'c','query exists')"
  567.       call lineout 'FM2.CMD', "    if arg6 = '' then"
  568.       call lineout 'FM2.CMD', "    do"
  569.       call lineout 'FM2.CMD', "      arg6 = directory(arg0)"
  570.       call lineout 'FM2.CMD', "      call directory mydir"
  571.       call lineout 'FM2.CMD', "    end"
  572.       call lineout 'FM2.CMD', "  end"
  573.       call lineout 'FM2.CMD', "end"
  574.       call lineout 'FM2.CMD', "if arg7 \= '' then "
  575.       call lineout 'FM2.CMD', "do"
  576.       call lineout 'FM2.CMD', "  if left(arg7,1,1) \= '/' then"
  577.       call lineout 'FM2.CMD', "  do"
  578.       call lineout 'FM2.CMD', "    arg0 = arg7"
  579.       call lineout 'FM2.CMD', "    arg7 = stream(arg7,'c','query exists')"
  580.       call lineout 'FM2.CMD', "    if arg7 = '' then"
  581.       call lineout 'FM2.CMD', "    do"
  582.       call lineout 'FM2.CMD', "      arg7 = directory(arg0)"
  583.       call lineout 'FM2.CMD', "      call directory mydir"
  584.       call lineout 'FM2.CMD', "    end"
  585.       call lineout 'FM2.CMD', "  end"
  586.       call lineout 'FM2.CMD', "end"
  587.       call lineout 'FM2.CMD', "if arg8 \= '' then "
  588.       call lineout 'FM2.CMD', "do"
  589.       call lineout 'FM2.CMD', "  if left(arg8,1,1) \= '/' then"
  590.       call lineout 'FM2.CMD', "  do"
  591.       call lineout 'FM2.CMD', "    arg0 = arg8"
  592.       call lineout 'FM2.CMD', "    arg8 = stream(arg8,'c','query exists')"
  593.       call lineout 'FM2.CMD', "    if arg8 = '' then"
  594.       call lineout 'FM2.CMD', "    do"
  595.       call lineout 'FM2.CMD', "      arg8 = directory(arg0)"
  596.       call lineout 'FM2.CMD', "      call directory mydir"
  597.       call lineout 'FM2.CMD', "    end"
  598.       call lineout 'FM2.CMD', "  end"
  599.       call lineout 'FM2.CMD', "end"
  600.       call lineout 'FM2.CMD', "if arg9 \= '' then "
  601.       call lineout 'FM2.CMD', "do"
  602.       call lineout 'FM2.CMD', "  if left(arg9,1,1) \= '/' then"
  603.       call lineout 'FM2.CMD', "  do"
  604.       call lineout 'FM2.CMD', "    arg0 = arg9"
  605.       call lineout 'FM2.CMD', "    arg9 = stream(arg9,'c','query exists')"
  606.       call lineout 'FM2.CMD', "    if arg9 = '' then"
  607.       call lineout 'FM2.CMD', "    do"
  608.       call lineout 'FM2.CMD', "      arg9 = directory(arg0)"
  609.       call lineout 'FM2.CMD', "      call directory mydir"
  610.       call lineout 'FM2.CMD', "    end"
  611.       call lineout 'FM2.CMD', "  end"
  612.       call lineout 'FM2.CMD', "end"
  613.     call lineout 'FM2.CMD', "n = setlocal()"
  614.     call lineout 'FM2.CMD', "n = directory('"curdir"')"
  615.     call lineout 'FM2.CMD', "'start fm3.exe 'arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  616.     call lineout 'FM2.CMD', "n = endlocal()"
  617.     call stream 'FM2.CMD','C','close'
  618.     'del AV2.CMD 1>NUL 2>NUL'
  619.     dummy = stream('AV2.CMD','C','open')
  620.     if dummy = 'READY:' then
  621.     do
  622.       say 'Creating an AV2.CMD file.'
  623.       call lineout 'AV2.CMD', "/* AV/2 command file.  Locate in a directory"
  624.       call lineout 'AV2.CMD', " * on your PATH. */"
  625.       call lineout 'AV2.CMD', "'@echo off'"
  626.       call lineout 'AV2.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  627.       call lineout 'AV2.CMD', "if arg1 \= '' then "
  628.       call lineout 'AV2.CMD', "do"
  629.       call lineout 'AV2.CMD', "  if left(arg1,1,1) \= '/' then"
  630.       call lineout 'AV2.CMD', "  do"
  631.       call lineout 'AV2.CMD', "    arg1 = stream(arg1,'c','query exists')"
  632.       call lineout 'AV2.CMD', "  end"
  633.       call lineout 'AV2.CMD', "end"
  634.       call lineout 'AV2.CMD', "else arg1 = directory()"
  635.       call lineout 'AV2.CMD', "if arg2 \= '' then "
  636.       call lineout 'AV2.CMD', "do"
  637.       call lineout 'AV2.CMD', "  if left(arg2,1,1) \= '/' then"
  638.       call lineout 'AV2.CMD', "  do"
  639.       call lineout 'AV2.CMD', "    arg2 = stream(arg2,'c','query exists')"
  640.       call lineout 'AV2.CMD', "  end"
  641.       call lineout 'AV2.CMD', "end"
  642.       call lineout 'AV2.CMD', "if arg3 \= '' then "
  643.       call lineout 'AV2.CMD', "do"
  644.       call lineout 'AV2.CMD', "  if left(arg3,1,1) \= '/' then"
  645.       call lineout 'AV2.CMD', "  do"
  646.       call lineout 'AV2.CMD', "    arg3 = stream(arg3,'c','query exists')"
  647.       call lineout 'AV2.CMD', "  end"
  648.       call lineout 'AV2.CMD', "end"
  649.       call lineout 'AV2.CMD', "if arg4 \= '' then "
  650.       call lineout 'AV2.CMD', "do"
  651.       call lineout 'AV2.CMD', "  if left(arg4,1,1) \= '/' then"
  652.       call lineout 'AV2.CMD', "  do"
  653.       call lineout 'AV2.CMD', "    arg4 = stream(arg4,'c','query exists')"
  654.       call lineout 'AV2.CMD', "  end"
  655.       call lineout 'AV2.CMD', "end"
  656.       call lineout 'AV2.CMD', "if arg5 \= '' then "
  657.       call lineout 'AV2.CMD', "do"
  658.       call lineout 'AV2.CMD', "  if left(arg5,1,1) \= '/' then"
  659.       call lineout 'AV2.CMD', "  do"
  660.       call lineout 'AV2.CMD', "    arg5 = stream(arg5,'c','query exists')"
  661.       call lineout 'AV2.CMD', "  end"
  662.       call lineout 'AV2.CMD', "end"
  663.       call lineout 'AV2.CMD', "if arg6 \= '' then "
  664.       call lineout 'AV2.CMD', "do"
  665.       call lineout 'AV2.CMD', "  if left(arg6,1,1) \= '/' then"
  666.       call lineout 'AV2.CMD', "  do"
  667.       call lineout 'AV2.CMD', "    arg6 = stream(arg6,'c','query exists')"
  668.       call lineout 'AV2.CMD', "  end"
  669.       call lineout 'AV2.CMD', "end"
  670.       call lineout 'AV2.CMD', "if arg7 \= '' then "
  671.       call lineout 'AV2.CMD', "do"
  672.       call lineout 'AV2.CMD', "  if left(arg7,1,1) \= '/' then"
  673.       call lineout 'AV2.CMD', "  do"
  674.       call lineout 'AV2.CMD', "    arg7 = stream(arg7,'c','query exists')"
  675.       call lineout 'AV2.CMD', "  end"
  676.       call lineout 'AV2.CMD', "end"
  677.       call lineout 'AV2.CMD', "if arg8 \= '' then "
  678.       call lineout 'AV2.CMD', "do"
  679.       call lineout 'AV2.CMD', "  if left(arg8,1,1) \= '/' then"
  680.       call lineout 'AV2.CMD', "  do"
  681.       call lineout 'AV2.CMD', "    arg8 = stream(arg8,'c','query exists')"
  682.       call lineout 'AV2.CMD', "  end"
  683.       call lineout 'AV2.CMD', "end"
  684.       call lineout 'AV2.CMD', "if arg9 \= '' then "
  685.       call lineout 'AV2.CMD', "do"
  686.       call lineout 'AV2.CMD', "  if left(arg9,1,1) \= '/' then"
  687.       call lineout 'AV2.CMD', "  do"
  688.       call lineout 'AV2.CMD', "    arg9 = stream(arg9,'c','query exists')"
  689.       call lineout 'AV2.CMD', "  end"
  690.       call lineout 'AV2.CMD', "end"
  691.       call lineout 'AV2.CMD', "n = setlocal()"
  692.       call lineout 'AV2.CMD', "n = directory('"curdir"')"
  693.       call lineout 'AV2.CMD', "'start av2.exe 'arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  694.       call lineout 'AV2.CMD', "n = endlocal()"
  695.       call stream 'AV2.CMD','C','close'
  696.     end
  697.     else say "Couldn't create AV2.CMD file."
  698.     'del VDIR.CMD 1>NUL 2>NUL'
  699.     dummy = stream('VDIR.CMD','C','open')
  700.     if dummy = 'READY:' then
  701.     do
  702.       say 'Creating a VDIR.CMD file.'
  703.       call lineout 'VDIR.CMD', "/* VDIR (FM/2) command file.  Locate in a directory"
  704.       call lineout 'VDIR.CMD', " * on your PATH. */"
  705.       call lineout 'VDIR.CMD', "'@echo off'"
  706.       call lineout 'VDIR.CMD', "mydir = directory()"
  707.       call lineout 'VDIR.CMD', "arg arg1 arg2"
  708.       call lineout 'VDIR.CMD', "if arg1 \= '' then "
  709.       call lineout 'VDIR.CMD', "do"
  710.       call lineout 'VDIR.CMD', "  if left(arg1,1,1) \= '/' then"
  711.       call lineout 'VDIR.CMD', "  do"
  712.       call lineout 'VDIR.CMD', "    arg0 = arg1"
  713.       call lineout 'VDIR.CMD', "    arg1 = stream(arg1,'c','query exists')"
  714.       call lineout 'VDIR.CMD', "    if arg1 = '' then"
  715.       call lineout 'VDIR.CMD', "    do"
  716.       call lineout 'VDIR.CMD', "      arg1 = directory(arg0)"
  717.       call lineout 'VDIR.CMD', "      call directory mydir"
  718.       call lineout 'VDIR.CMD', "    end"
  719.       call lineout 'VDIR.CMD', "  end"
  720.       call lineout 'VDIR.CMD', "end"
  721.       call lineout 'VDIR.CMD', "else arg1 = mydir"
  722.       call lineout 'VDIR.CMD', "n = setlocal()"
  723.       call lineout 'VDIR.CMD', "n = directory('"curdir"')"
  724.       call lineout 'VDIR.CMD', "'start vdir.exe 'arg1 '%2 %3 %4 %5 %6 %7 %8 %9"
  725.       call lineout 'VDIR.CMD', "n = endlocal()"
  726.       call stream 'VDIR.CMD','C','close'
  727.     end
  728.     else say "Couldn't create VDIR.CMD file."
  729.     'del VTREE.CMD 1>NUL 2>NUL'
  730.     dummy = stream('VTREE.CMD','C','open')
  731.     if dummy = 'READY:' then
  732.     do
  733.       say 'Creating a VTREE.CMD file.'
  734.       call lineout 'VTREE.CMD', "/* VTREE (FM/2) command file.  Locate in a directory"
  735.       call lineout 'VTREE.CMD', " * on your PATH. */"
  736.       call lineout 'VTREE.CMD', "'@echo off'"
  737.       call lineout 'VTREE.CMD', "n = setlocal()"
  738.       call lineout 'VTREE.CMD', "n = directory('"curdir"')"
  739.       call lineout 'VTREE.CMD', "'start vtree.exe %1 %2 %3 %4 %5 %6 %7 %8 %9'"
  740.       call lineout 'VTREE.CMD', "n = endlocal()"
  741.       call stream 'VTREE.CMD','C','close'
  742.     end
  743.     else say "Couldn't create VTREE.CMD file."
  744.     'del VCOLLECT.CMD 1>NUL 2>NUL'
  745.     dummy = stream('VCOLLECT.CMD','C','open')
  746.     if dummy = 'READY:' then
  747.     do
  748.       say 'Creating a VCOLLECT.CMD file.'
  749.       call lineout 'VCOLLECT.CMD', "/* VCOLLECT (FM/2) command file.  Locate in a directory"
  750.       call lineout 'VCOLLECT.CMD', " * on your PATH. */"
  751.       call lineout 'VCOLLECT.CMD', "'@echo off'"
  752.       call lineout 'VCOLLECT.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  753.       call lineout 'VCOLLECT.CMD', "if arg1 \= '' then "
  754.       call lineout 'VCOLLECT.CMD', "do"
  755.       call lineout 'VCOLLECT.CMD', "  if left(arg1,1,1) \= '/' then"
  756.       call lineout 'VCOLLECT.CMD', "  do"
  757.       call lineout 'VCOLLECT.CMD', "    arg1 = stream(arg1,'c','query exists')"
  758.       call lineout 'VCOLLECT.CMD', "  end"
  759.       call lineout 'VCOLLECT.CMD', "end"
  760.       call lineout 'VCOLLECT.CMD', "if arg2 \= '' then "
  761.       call lineout 'VCOLLECT.CMD', "do"
  762.       call lineout 'VCOLLECT.CMD', "  if left(arg2,1,1) \= '/' then"
  763.       call lineout 'VCOLLECT.CMD', "  do"
  764.       call lineout 'VCOLLECT.CMD', "    arg2 = stream(arg2,'c','query exists')"
  765.       call lineout 'VCOLLECT.CMD', "  end"
  766.       call lineout 'VCOLLECT.CMD', "end"
  767.       call lineout 'VCOLLECT.CMD', "if arg3 \= '' then "
  768.       call lineout 'VCOLLECT.CMD', "do"
  769.       call lineout 'VCOLLECT.CMD', "  if left(arg3,1,1) \= '/' then"
  770.       call lineout 'VCOLLECT.CMD', "  do"
  771.       call lineout 'VCOLLECT.CMD', "    arg3 = stream(arg3,'c','query exists')"
  772.       call lineout 'VCOLLECT.CMD', "  end"
  773.       call lineout 'VCOLLECT.CMD', "end"
  774.       call lineout 'VCOLLECT.CMD', "if arg4 \= '' then "
  775.       call lineout 'VCOLLECT.CMD', "do"
  776.       call lineout 'VCOLLECT.CMD', "  if left(arg4,1,1) \= '/' then"
  777.       call lineout 'VCOLLECT.CMD', "  do"
  778.       call lineout 'VCOLLECT.CMD', "    arg4 = stream(arg4,'c','query exists')"
  779.       call lineout 'VCOLLECT.CMD', "  end"
  780.       call lineout 'VCOLLECT.CMD', "end"
  781.       call lineout 'VCOLLECT.CMD', "if arg5 \= '' then "
  782.       call lineout 'VCOLLECT.CMD', "do"
  783.       call lineout 'VCOLLECT.CMD', "  if left(arg5,1,1) \= '/' then"
  784.       call lineout 'VCOLLECT.CMD', "  do"
  785.       call lineout 'VCOLLECT.CMD', "    arg5 = stream(arg5,'c','query exists')"
  786.       call lineout 'VCOLLECT.CMD', "  end"
  787.       call lineout 'VCOLLECT.CMD', "end"
  788.       call lineout 'VCOLLECT.CMD', "if arg6 \= '' then "
  789.       call lineout 'VCOLLECT.CMD', "do"
  790.       call lineout 'VCOLLECT.CMD', "  if left(arg6,1,1) \= '/' then"
  791.       call lineout 'VCOLLECT.CMD', "  do"
  792.       call lineout 'VCOLLECT.CMD', "    arg6 = stream(arg6,'c','query exists')"
  793.       call lineout 'VCOLLECT.CMD', "  end"
  794.       call lineout 'VCOLLECT.CMD', "end"
  795.       call lineout 'VCOLLECT.CMD', "if arg7 \= '' then "
  796.       call lineout 'VCOLLECT.CMD', "do"
  797.       call lineout 'VCOLLECT.CMD', "  if left(arg7,1,1) \= '/' then"
  798.       call lineout 'VCOLLECT.CMD', "  do"
  799.       call lineout 'VCOLLECT.CMD', "    arg7 = stream(arg7,'c','query exists')"
  800.       call lineout 'VCOLLECT.CMD', "  end"
  801.       call lineout 'VCOLLECT.CMD', "end"
  802.       call lineout 'VCOLLECT.CMD', "if arg8 \= '' then "
  803.       call lineout 'VCOLLECT.CMD', "do"
  804.       call lineout 'VCOLLECT.CMD', "  if left(arg8,1,1) \= '/' then"
  805.       call lineout 'VCOLLECT.CMD', "  do"
  806.       call lineout 'VCOLLECT.CMD', "    arg8 = stream(arg8,'c','query exists')"
  807.       call lineout 'VCOLLECT.CMD', "  end"
  808.       call lineout 'VCOLLECT.CMD', "end"
  809.       call lineout 'VCOLLECT.CMD', "if arg9 \= '' then "
  810.       call lineout 'VCOLLECT.CMD', "do"
  811.       call lineout 'VCOLLECT.CMD', "  if left(arg9,1,1) \= '/' then"
  812.       call lineout 'VCOLLECT.CMD', "  do"
  813.       call lineout 'VCOLLECT.CMD', "    arg9 = stream(arg9,'c','query exists')"
  814.       call lineout 'VCOLLECT.CMD', "  end"
  815.       call lineout 'VCOLLECT.CMD', "end"
  816.       call lineout 'VCOLLECT.CMD', "n = setlocal()"
  817.       call lineout 'VCOLLECT.CMD', "n = directory('"curdir"')"
  818.       call lineout 'VCOLLECT.CMD', "'start vcollect.exe 'arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  819.       call lineout 'VCOLLECT.CMD', "n = endlocal()"
  820.       call stream 'VCOLLECT.CMD','C','close'
  821.     end
  822.     else say "Couldn't create VCOLLECT.CMD file."
  823.     'del INI.CMD 1>NUL 2>NUL'
  824.     dummy = stream('INI.CMD','C','open')
  825.     if dummy = 'READY:' then
  826.     do
  827.       say 'Creating an INI.CMD file.'
  828.       call lineout 'INI.CMD', "/* INI (FM/2) command file.  Locate in a directory"
  829.       call lineout 'INI.CMD', " * on your PATH. */"
  830.       call lineout 'INI.CMD', "'@echo off'"
  831.       call lineout 'INI.CMD', "arg arg1"
  832.       call lineout 'INI.CMD', "if arg1 \= '' then arg1 = stream(arg1,'c','query exists')"
  833.       call lineout 'INI.CMD', "n = setlocal()"
  834.       call lineout 'INI.CMD', "n = directory('"curdir"')"
  835.       call lineout 'INI.CMD', "'start INI.exe 'arg1"
  836.       call lineout 'INI.CMD', "n = endlocal()"
  837.       call stream 'INI.CMD','C','close'
  838.     end
  839.     else say "Couldn't create INI.CMD file."
  840.     'del EAS.CMD 1>NUL 2>NUL'
  841.     dummy = stream('EAS.CMD','C','open')
  842.     if dummy = 'READY:' then
  843.     do
  844.       say 'Creating an EAS.CMD file.'
  845.       call lineout 'EAS.CMD', "/* EAS (FM/2) command file.  Locate in a directory"
  846.       call lineout 'EAS.CMD', " * on your PATH. */"
  847.       call lineout 'EAS.CMD', "'@echo off'"
  848.       call lineout 'EAS.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  849.       call lineout 'EAS.CMD', "if arg1 \= '' then "
  850.       call lineout 'EAS.CMD', "do"
  851.       call lineout 'EAS.CMD', "  if left(arg1,1,1) \= '/' then"
  852.       call lineout 'EAS.CMD', "  do"
  853.       call lineout 'EAS.CMD', "    arg1 = stream(arg1,'c','query exists')"
  854.       call lineout 'EAS.CMD', "  end"
  855.       call lineout 'EAS.CMD', "end"
  856.       call lineout 'EAS.CMD', "else arg1 = directory()"
  857.       call lineout 'EAS.CMD', "if arg2 \= '' then "
  858.       call lineout 'EAS.CMD', "do"
  859.       call lineout 'EAS.CMD', "  if left(arg2,1,1) \= '/' then"
  860.       call lineout 'EAS.CMD', "  do"
  861.       call lineout 'EAS.CMD', "    arg2 = stream(arg2,'c','query exists')"
  862.       call lineout 'EAS.CMD', "  end"
  863.       call lineout 'EAS.CMD', "end"
  864.       call lineout 'EAS.CMD', "if arg3 \= '' then "
  865.       call lineout 'EAS.CMD', "do"
  866.       call lineout 'EAS.CMD', "  if left(arg3,1,1) \= '/' then"
  867.       call lineout 'EAS.CMD', "  do"
  868.       call lineout 'EAS.CMD', "    arg3 = stream(arg3,'c','query exists')"
  869.       call lineout 'EAS.CMD', "  end"
  870.       call lineout 'EAS.CMD', "end"
  871.       call lineout 'EAS.CMD', "if arg4 \= '' then "
  872.       call lineout 'EAS.CMD', "do"
  873.       call lineout 'EAS.CMD', "  if left(arg4,1,1) \= '/' then"
  874.       call lineout 'EAS.CMD', "  do"
  875.       call lineout 'EAS.CMD', "    arg4 = stream(arg4,'c','query exists')"
  876.       call lineout 'EAS.CMD', "  end"
  877.       call lineout 'EAS.CMD', "end"
  878.       call lineout 'EAS.CMD', "if arg5 \= '' then "
  879.       call lineout 'EAS.CMD', "do"
  880.       call lineout 'EAS.CMD', "  if left(arg5,1,1) \= '/' then"
  881.       call lineout 'EAS.CMD', "  do"
  882.       call lineout 'EAS.CMD', "    arg5 = stream(arg5,'c','query exists')"
  883.       call lineout 'EAS.CMD', "  end"
  884.       call lineout 'EAS.CMD', "end"
  885.       call lineout 'EAS.CMD', "if arg6 \= '' then "
  886.       call lineout 'EAS.CMD', "do"
  887.       call lineout 'EAS.CMD', "  if left(arg6,1,1) \= '/' then"
  888.       call lineout 'EAS.CMD', "  do"
  889.       call lineout 'EAS.CMD', "    arg6 = stream(arg6,'c','query exists')"
  890.       call lineout 'EAS.CMD', "  end"
  891.       call lineout 'EAS.CMD', "end"
  892.       call lineout 'EAS.CMD', "if arg7 \= '' then "
  893.       call lineout 'EAS.CMD', "do"
  894.       call lineout 'EAS.CMD', "  if left(arg7,1,1) \= '/' then"
  895.       call lineout 'EAS.CMD', "  do"
  896.       call lineout 'EAS.CMD', "    arg7 = stream(arg7,'c','query exists')"
  897.       call lineout 'EAS.CMD', "  end"
  898.       call lineout 'EAS.CMD', "end"
  899.       call lineout 'EAS.CMD', "if arg8 \= '' then "
  900.       call lineout 'EAS.CMD', "do"
  901.       call lineout 'EAS.CMD', "  if left(arg8,1,1) \= '/' then"
  902.       call lineout 'EAS.CMD', "  do"
  903.       call lineout 'EAS.CMD', "    arg8 = stream(arg8,'c','query exists')"
  904.       call lineout 'EAS.CMD', "  end"
  905.       call lineout 'EAS.CMD', "end"
  906.       call lineout 'EAS.CMD', "if arg9 \= '' then "
  907.       call lineout 'EAS.CMD', "do"
  908.       call lineout 'EAS.CMD', "  if left(arg9,1,1) \= '/' then"
  909.       call lineout 'EAS.CMD', "  do"
  910.       call lineout 'EAS.CMD', "    arg9 = stream(arg9,'c','query exists')"
  911.       call lineout 'EAS.CMD', "  end"
  912.       call lineout 'EAS.CMD', "end"
  913.       call lineout 'EAS.CMD', "n = setlocal()"
  914.       call lineout 'EAS.CMD', "n = directory('"curdir"')"
  915.       call lineout 'EAS.CMD', "'start eas.exe 'arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  916.       call lineout 'EAS.CMD', "n = endlocal()"
  917.       call stream 'EAS.CMD','C','close'
  918.     end
  919.     else say "Couldn't create EAS.CMD file."
  920.     'del UNDEL.CMD 1>NUL 2>NUL'
  921.     dummy = stream('UNDEL.CMD','C','open')
  922.     if dummy = 'READY:' then
  923.     do
  924.       say 'Creating an UNDEL.CMD file.'
  925.       call lineout 'UNDEL.CMD', "/* UNDEL (FM/2) command file.  Locate in a directory"
  926.       call lineout 'UNDEL.CMD', " * on your PATH. */"
  927.       call lineout 'UNDEL.CMD', "'@echo off'"
  928.       call lineout 'UNDEL.CMD', "n = setlocal()"
  929.       call lineout 'UNDEL.CMD', "n = directory('"curdir"')"
  930.       call lineout 'UNDEL.CMD', "'start undel.exe %1'"
  931.       call lineout 'UNDEL.CMD', "n = endlocal()"
  932.       call stream 'UNDEL.CMD','C','close'
  933.     end
  934.     else say "Couldn't create UNDEL.CMD file."
  935.     'del KILLPROC.CMD 1>NUL 2>NUL'
  936.     dummy = stream('KILLPROC.CMD','C','open')
  937.     if dummy = 'READY:' then
  938.     do
  939.       say 'Creating a KILLPROC.CMD file.'
  940.       call lineout 'KILLPROC.CMD', "/* KILLPROC (FM/2) command file.  Locate in a directory"
  941.       call lineout 'KILLPROC.CMD', " * on your PATH. */"
  942.       call lineout 'KILLPROC.CMD', "'@echo off'"
  943.       call lineout 'KILLPROC.CMD', "n = setlocal()"
  944.       call lineout 'KILLPROC.CMD', "n = directory('"curdir"')"
  945.       call lineout 'KILLPROC.CMD', "'start killproc.exe'"
  946.       call lineout 'KILLPROC.CMD', "n = endlocal()"
  947.       call stream 'KILLPROC.CMD','C','close'
  948.     end
  949.     else say "Couldn't create KILLPROC.CMD file."
  950.     'del VIEWINFS.CMD 1>NUL 2>NUL'
  951.     dummy = stream('VIEWINFS.CMD','C','open')
  952.     if dummy = 'READY:' then
  953.     do
  954.       say 'Creating a VIEWINFS.CMD file.'
  955.       call lineout 'VIEWINFS.CMD', "/* VIEWINFS (FM/2) command file.  Locate in a directory"
  956.       call lineout 'VIEWINFS.CMD', " * on your PATH. */"
  957.       call lineout 'VIEWINFS.CMD', "'@echo off'"
  958.       call lineout 'VIEWINFS.CMD', "n = setlocal()"
  959.       call lineout 'VIEWINFS.CMD', "n = directory('"curdir"')"
  960.       call lineout 'VIEWINFS.CMD', "'start viewinfs.exe'"
  961.       call lineout 'VIEWINFS.CMD', "n = endlocal()"
  962.       call stream 'VIEWINFS.CMD','C','close'
  963.     end
  964.     else say "Couldn't create VIEWINFS.CMD file."
  965.     'del VIEWHELP.CMD 1>NUL 2>NUL'
  966.     dummy = stream('VIEWHELP.CMD','C','open')
  967.     if dummy = 'READY:' then
  968.     do
  969.       say 'Creating a VIEWHELP.CMD file.'
  970.       call lineout 'VIEWHELP.CMD', "/* VIEWHELP (FM/2) command file.  Locate in a directory"
  971.       call lineout 'VIEWHELP.CMD', " * on your PATH. */"
  972.       call lineout 'VIEWHELP.CMD', "'@echo off'"
  973.       call lineout 'VIEWHELP.CMD', "n = setlocal()"
  974.       call lineout 'VIEWHELP.CMD', "n = directory('"curdir"')"
  975.       call lineout 'VIEWHELP.CMD', "'start viewinfs.exe DUMMY'"
  976.       call lineout 'VIEWHELP.CMD', "n = endlocal()"
  977.       call stream 'VIEWHELP.CMD','C','close'
  978.     end
  979.     else say "Couldn't create VIEWHELP.CMD file."
  980.     'del GLOBAL.CMD 1>NUL 2>NUL'
  981.     dummy = stream('GLOBAL.CMD','C','open')
  982.     if dummy = 'READY:' then
  983.     do
  984.       say 'Creating a GLOBAL.CMD file.'
  985.       call lineout 'GLOBAL.CMD', "/* GLOBAL (FM/2) command file.  Locate in a directory"
  986.       call lineout 'GLOBAL.CMD', " * on your PATH. */"
  987.       call lineout 'GLOBAL.CMD', "'@echo off'"
  988.       call lineout 'GLOBAL.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  989.       call lineout 'GLOBAL.CMD', "if arg1 \= '' then "
  990.       call lineout 'GLOBAL.CMD', "do"
  991.       call lineout 'GLOBAL.CMD', "  if left(arg1,1,1) \= '/' then"
  992.       call lineout 'GLOBAL.CMD', "  do"
  993.       call lineout 'GLOBAL.CMD', "    arg1 = stream(arg1,'c','query exists')"
  994.       call lineout 'GLOBAL.CMD', "  end"
  995.       call lineout 'GLOBAL.CMD', "end"
  996.       call lineout 'GLOBAL.CMD', "else arg1 = directory()"
  997.       call lineout 'GLOBAL.CMD', "if arg2 \= '' then "
  998.       call lineout 'GLOBAL.CMD', "do"
  999.       call lineout 'GLOBAL.CMD', "  if left(arg2,1,1) \= '/' then"
  1000.       call lineout 'GLOBAL.CMD', "  do"
  1001.       call lineout 'GLOBAL.CMD', "    arg2 = stream(arg2,'c','query exists')"
  1002.       call lineout 'GLOBAL.CMD', "  end"
  1003.       call lineout 'GLOBAL.CMD', "end"
  1004.       call lineout 'GLOBAL.CMD', "if arg3 \= '' then "
  1005.       call lineout 'GLOBAL.CMD', "do"
  1006.       call lineout 'GLOBAL.CMD', "  if left(arg3,1,1) \= '/' then"
  1007.       call lineout 'GLOBAL.CMD', "  do"
  1008.       call lineout 'GLOBAL.CMD', "    arg3 = stream(arg3,'c','query exists')"
  1009.       call lineout 'GLOBAL.CMD', "  end"
  1010.       call lineout 'GLOBAL.CMD', "end"
  1011.       call lineout 'GLOBAL.CMD', "if arg4 \= '' then "
  1012.       call lineout 'GLOBAL.CMD', "do"
  1013.       call lineout 'GLOBAL.CMD', "  if left(arg4,1,1) \= '/' then"
  1014.       call lineout 'GLOBAL.CMD', "  do"
  1015.       call lineout 'GLOBAL.CMD', "    arg4 = stream(arg4,'c','query exists')"
  1016.       call lineout 'GLOBAL.CMD', "  end"
  1017.       call lineout 'GLOBAL.CMD', "end"
  1018.       call lineout 'GLOBAL.CMD', "if arg5 \= '' then "
  1019.       call lineout 'GLOBAL.CMD', "do"
  1020.       call lineout 'GLOBAL.CMD', "  if left(arg5,1,1) \= '/' then"
  1021.       call lineout 'GLOBAL.CMD', "  do"
  1022.       call lineout 'GLOBAL.CMD', "    arg5 = stream(arg5,'c','query exists')"
  1023.       call lineout 'GLOBAL.CMD', "  end"
  1024.       call lineout 'GLOBAL.CMD', "end"
  1025.       call lineout 'GLOBAL.CMD', "if arg6 \= '' then "
  1026.       call lineout 'GLOBAL.CMD', "do"
  1027.       call lineout 'GLOBAL.CMD', "  if left(arg6,1,1) \= '/' then"
  1028.       call lineout 'GLOBAL.CMD', "  do"
  1029.       call lineout 'GLOBAL.CMD', "    arg6 = stream(arg6,'c','query exists')"
  1030.       call lineout 'GLOBAL.CMD', "  end"
  1031.       call lineout 'GLOBAL.CMD', "end"
  1032.       call lineout 'GLOBAL.CMD', "if arg7 \= '' then "
  1033.       call lineout 'GLOBAL.CMD', "do"
  1034.       call lineout 'GLOBAL.CMD', "  if left(arg7,1,1) \= '/' then"
  1035.       call lineout 'GLOBAL.CMD', "  do"
  1036.       call lineout 'GLOBAL.CMD', "    arg7 = stream(arg7,'c','query exists')"
  1037.       call lineout 'GLOBAL.CMD', "  end"
  1038.       call lineout 'GLOBAL.CMD', "end"
  1039.       call lineout 'GLOBAL.CMD', "if arg8 \= '' then "
  1040.       call lineout 'GLOBAL.CMD', "do"
  1041.       call lineout 'GLOBAL.CMD', "  if left(arg8,1,1) \= '/' then"
  1042.       call lineout 'GLOBAL.CMD', "  do"
  1043.       call lineout 'GLOBAL.CMD', "    arg8 = stream(arg8,'c','query exists')"
  1044.       call lineout 'GLOBAL.CMD', "  end"
  1045.       call lineout 'GLOBAL.CMD', "end"
  1046.       call lineout 'GLOBAL.CMD', "if arg9 \= '' then "
  1047.       call lineout 'GLOBAL.CMD', "do"
  1048.       call lineout 'GLOBAL.CMD', "  if left(arg9,1,1) \= '/' then"
  1049.       call lineout 'GLOBAL.CMD', "  do"
  1050.       call lineout 'GLOBAL.CMD', "    arg9 = stream(arg9,'c','query exists')"
  1051.       call lineout 'GLOBAL.CMD', "  end"
  1052.       call lineout 'GLOBAL.CMD', "end"
  1053.       call lineout 'GLOBAL.CMD', "n = setlocal()"
  1054.       call lineout 'GLOBAL.CMD', "n = directory('"curdir"')"
  1055.       call lineout 'GLOBAL.CMD', "'start global.exe' arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  1056.       call lineout 'GLOBAL.CMD', "n = endlocal()"
  1057.       call stream 'GLOBAL.CMD','C','close'
  1058.     end
  1059.     else say "Couldn't create GLOBAL.CMD file."
  1060.     say ""
  1061.     parse upper var curdir curdir
  1062.     say "Please add the directory"
  1063.     say "  "curdir"\UTILS"
  1064.     say "to your PATH in CONFIG.SYS."
  1065.     say "┌──────────────────────────────────────────────────────────────────┐"
  1066.     say "│Remember, you'll need to reboot before such a change takes effect.│"
  1067.     say "│FM/2 will run fine from its WPS objects without this change; the  │"
  1068.     say "│proposed change allows it to be run from any command line, and for│"
  1069.     say "│other programs that might want to use FM/2 as its file manager to │"
  1070.     say "│find and run it easily.                                           │"
  1071.     say "└──────────────────────────────────────────────────────────────────┘"
  1072.     say "While you're in there, check your LIBPATH statement for a '.' entry..."
  1073.     if existed \= "TRUE" then
  1074.     do
  1075.       say ""
  1076.       /* remove next 6 lines for unattended use */
  1077.       call charout ,'  Press [Enter] for more...'
  1078.       dummy = ''
  1079.       do until dummy = '0d'x
  1080.         dummy = SysGetKey('NOECHO')
  1081.       end
  1082.       call charout ,'0d1b'x'[K'
  1083.       rc = stream('fatopt.exe','c','query exists')
  1084.       say   "┌────────────────────────────────────────────────────────────────┐"
  1085.       if rc = '' then
  1086.       do
  1087.         say "│I suggest that you place the utilities from the FM/2 Utilities  │"
  1088.         say "│archive in this directory, also, in which case you should       │"
  1089.         say "│_definitely_ make the change to PATH so that FM/2 can find them.│"
  1090.       end
  1091.       say   "│You may want to tweak the command lines in the .CMD files I just│"
  1092.       say   "│built and/or those in the WPS objects in the FM/2 folder for    │"
  1093.       say   "│desired specific behaviors.  The READ.ME file will tell you how.│"
  1094.       say   "└────────────────────────────────────────────────────────────────┘"
  1095.     end
  1096.     if existed = 'TRUE' then
  1097.     do
  1098.       say ''
  1099.       say "If you have previously altered your CONFIG.SYS's PATH statement"
  1100.       say 'as instructed above, please ignore this rambling.'
  1101.     end
  1102.     say ""
  1103.     /* remove next 6 lines for unattended use */
  1104.     call charout ,'  Press [Enter] to continue...'
  1105.     dummy = ''
  1106.     do until dummy = '0d'x
  1107.       dummy = SysGetKey('NOECHO')
  1108.     end
  1109.     call charout ,'0d1b'x'[K'
  1110.   end
  1111.   else say "Couldn't create FM2.CMD file.  Panic."
  1112.   dummy = directory(curdir)
  1113. end
  1114. else say "Couldn't switch to "curdir"\utils"
  1115.  
  1116. /* type the install.dat file to show any critical info/notices */
  1117.  
  1118. /* NOTE:  remove following 8 lines for unattended use... */
  1119. rc = stream('install.dat','c','query exists')
  1120. if rc \= '' then
  1121. do
  1122.   'type install.dat'
  1123.   'DEL INSTALL.DAT 1>NUL 2>NUL'
  1124.   /* remove next 6 lines for unattended use */
  1125.   call charout ,'  Press [Enter] to continue...'
  1126.   dummy = ''
  1127.   do until dummy = '0d'x
  1128.     dummy = SysGetKey('NOECHO')
  1129.   end
  1130.   call charout ,'0d1b'x'[K'
  1131. end
  1132.  
  1133. /* Final words */
  1134.  
  1135. say '┌──────────────────────────────────────────────────────────────────────────┐'
  1136. say '│To move FM/2 to another directory, move the files, delete the FM/2 folder,│'
  1137. say '│then rerun INSTALL.  There is no need to "uninstall" to move FM/2.        │'
  1138. say '│                                                                          │'
  1139. say '│To remove FM/2 completely, run UNINSTAL and follow its directions.        │'
  1140. say '└──────────────────────────────────────────────────────────────────────────┘'
  1141. say "I'm done now."
  1142. say ''
  1143.  
  1144.